errDn   dw  "Error division natural por cero" ;31

;division de naturales (div1/div2)
;
;   param1: div1
;   param2: div2
;
;   retorna el resultado en la punta del Stack
divN proc near
    push bp
    mov bp,sp
    push ax
    push bx
    push dx

    cmp [bp+4],0
    jz  errD0N
    mov dx,0
    mov ax, [bp+6]
    mov bx, [bp+4]
    div bx
    mov [bp+6],ax
    
    pop dx
    pop bx
    pop ax
    pop bp
    ret 2
errD0N:
    push offset errDn
    push 31
    call writeSTR
    jmp fin
divN endp
